<?php

declare(strict_types=1);
/**
 * This file is part of MoChat.
 * @link     https://mo.chat
 * @document https://mochat.wiki
 * @contact  group@mo.chat
 * @license  https://github.com/mochat-cloud/mochat/blob/master/LICENSE
 */
namespace MoChat\App\Client\Service;

use MoChat\App\Client\Contract\ClientFollowRecordContract;
use MoChat\App\Client\Model\ClientFollowRecord;
use MoChat\Framework\Service\AbstractService;

class ClientFollowRecordService extends AbstractService implements ClientFollowRecordContract
{

    /**
     * @var ClientFollowRecord
     */
    protected $model;

 
    /**
     * 多条分页.
     * @param array $where 查询条件
     * @param array|string[] $columns 查询字段
     * @param array $options 可选项 ['orderByRaw'=> 'id asc', 'perPage' => 15, 'page' => null, 'pageName' => 'page']
     * @return array 分页结果 Hyperf\Paginator\Paginator::toArray
     */
    public function getClientFollowRecordList(array $where, array $columns = ['*'], array $options = []): array
    {
        return $this->model->getPageList($where, $columns, $options);
    }


    /**
     * 添加单条
     * @param array $data 添加的数据
     * @return int 自增ID
     */
    public function createClientFollowRecord(array $data): int
    {
        return $this->model->createOne($data);
    }
}
